home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / MacMETH3.2.1 Folder / MacMETH3.2.1 Disk 1⁄2 / Examples / Example.MOD < prev    next >
Text File  |  1994-03-21  |  730b  |  24 lines

  1. MODULE Example;  (* W. Heiz, 26-Feb-86 / A. Fischlin, 4-Sep-92 *)
  2.  
  3.   (* this program will produce two runtime errors (why?) *)
  4.  
  5.   FROM Terminal IMPORT WriteString, WriteLn;
  6.  
  7.   VAR  x: INTEGER;
  8.        a: ARRAY [0..10] OF BOOLEAN;
  9.  
  10.   PROCEDURE P(i: INTEGER; p: BOOLEAN);
  11.   BEGIN
  12.     a[i] := p; (* this statement should be high-lighted; Select Quit, then «Abort» *)
  13.   END P;
  14.  
  15. BEGIN
  16.   WriteString('Welcome to the wonderful world of Modula-2'); WriteLn; WriteLn;
  17.   WriteString("--- Debugger demo, please click in button «Debug» or type 'D'"); WriteLn;
  18.   x := 14;
  19.   P(0, TRUE); 
  20.   HALT; (* Leave debugger by selecting menu command Continue *)
  21.   WriteString("--- Please click in button «Debug» or type 'D'");
  22.   P(x, FALSE);
  23. END Example.
  24.